<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		
		<link rel="stylesheet" href="static/css/datepicker.css" /><!-- 日期框 -->
		<style type="text/css">
		#dialog-add,#dialog-message,#dialog-comment{width:100%; height:100%; position:fixed; top:0px; z-index:99999999; display:none;}
		.commitopacity{position:absolute; width:100%; height:700px; background:#7f7f7f; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; top:0px; z-index:99999;}
		.commitbox{width:100%; margin:0px auto; position:absolute; top:0px; z-index:99999;}
		.commitbox_inner{width:96%; height:255px;  margin:6px auto; background:#efefef; border-radius:5px;}
		.commitbox_top{width:100%; height:250px; margin-bottom:10px; padding-top:10px; background:#FFF; border-radius:5px; box-shadow:1px 1px 3px #e8e8e8;}
		.commitbox_top textarea{width:95%; height:195px; display:block; margin:0px auto; border:0px;}
		.commitbox_cen{width:95%; height:40px; padding-top:10px;}
		.commitbox_cen div.left{float:left;background-size:15px; background-position:0px 3px; padding-left:18px; color:#f77500; font-size:16px; line-height:27px;}
		.commitbox_cen div.left img{width:30px;}
		.commitbox_cen div.right{float:right; margin-top:7px;}
		.commitbox_cen div.right span{cursor:pointer;}
		.commitbox_cen div.right span.save{border:solid 1px #c7c7c7; background:#6FB3E0; border-radius:3px; color:#FFF; padding:5px 10px;}
		.commitbox_cen div.right span.quxiao{border:solid 1px #f77400; background:#f77400; border-radius:3px; color:#FFF; padding:4px 9px;}
		</style>
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		
<script type="text/javascript">
	
</script>
	</head>
<body>
	<form action="bussactivity/saveApply.do" name="Form" id="Form" method="post">
		<input type="hidden" name="activity_id" id="activity_id" value="${pd.activity_id}"/>
		<input type="hidden" name="task_id" id="task_id" value="${act.taskId}"/>
		<input type="hidden" name="procIns_id" id="procIns_id" value="${act.procInsId}"/>
		<input type="hidden" name="flag" id="flag" value="${act.flag}"/>
		<input type="hidden" name="task_def_key" id="task_def_key" value="${act.taskDefKey}"/>
		<div id="zhongxin">
		<fieldset>
			<legend>活动策划审核</legend>
				<table id="table_report" class="table table-striped table-bordered table-hover">
					<tr>
				<td style="width:150px;text-align: right;">活动名称:</td>
				<td colspan="3">${pd.activity_name}</td>
			</tr>
			<tr>
				<td style="width:150px;text-align: right;">活动标题:</td>
				<td>${pd.activity_title}</td>
				<td style="width:150px;text-align: right;">活动对象:</td>
				<td>${pd.activity_object}</td>
			</tr>
			<tr>
				<td style="width:150px;text-align: right;">策划人:</td>
				<td>${pd.activity_planner}</td>
				<td style="width:150px;text-align: right;">申请时间:</td>
				<td>${pd.activity_time}</td>
			</tr>							
			<tr>
				<td style="width:150px;text-align: right;">申请状态:</td>
				<td>
				<c:if test="${pd.activity_status == 0}"><span style="color: orange;">审核中</span></c:if>
				<c:if test="${pd.activity_status == 1}"><span style="color: green;">审核成功</span></c:if>
				<c:if test="${pd.activity_status == 2}"><span style="color: red;">审核失败</span></c:if>
				</td>
				<td style="width:150px;text-align: right;">所属公司:</td>
				<td>${pd.company}</td>
			</tr>
			<tr>
				<td style="width:150px;text-align: right;">活动内容:</td>
				<td colspan="3"><script id="editor" name="editor" type="text/plain" style="width:550px;height:259px;">${pd.activity_content}</script></td>
			</tr>
					<tr>
						<td style="text-align:right;">您的意见:</td>
						<td colspan="3"><textarea id="comment" name="comment" rows="5" style="width:600px;outline:none;resize:none;" ></textarea></td>
					</tr>
					<tr>
						<td style="text-align: center;" colspan="10">
							<a class="btn btn-mini btn-primary" onclick="agree()">同 意</a>
							<a class="btn btn-mini btn-danger" onclick="noagree()">驳 回</a>
							<a class="btn btn-mini btn-danger" onclick="javascript:history.back(-1);">返回</a>
						</td>
					</tr>
				</table>
				</fieldset>
		</div>
		<fieldset>
			<legend>审核流程信息</legend>
			<div id="histoicFlowList">
				<table class="table table-striped table-bordered table-condensed">
					<tr><th>执行环节</th><th>执行人</th><th>开始时间</th><th>结束时间</th><th>提交意见</th><th>任务历时</th></tr>
					<c:forEach items="${varList}" var="act">
						<tr>
							<td>${act.histIns.activityName}</td>
							<td>${act.assigneeName}</td>
							<td><fmt:formatDate value="${act.histIns.startTime}" type="both"/></td>
							<td><fmt:formatDate value="${act.histIns.endTime}" type="both"/></td>
							<td style="word-wrap:break-word;word-break:break-all;">${act.comment}</td>
							<td>${act.durationTime}</td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</fieldset>
	</form>
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<!-- 编辑框-->
		<script type="text/javascript" charset="utf-8">window.UEDITOR_HOME_URL = "<%=path%>/plugins/ueditor/";</script>
		<script type="text/javascript" charset="utf-8" src="plugins/ueditor/ueditor.config.js"></script>
		<script type="text/javascript" charset="utf-8" src="plugins/ueditor/ueditor.all.js"></script>
		<!--引入属于此页面的js -->
		<script type="text/javascript" src="static/js/myjs/headEmail.js"></script>
		<!-- 编辑框-->
		<script type="text/javascript">
		function agree(){
			$('#flag').val('yes');
			$.ajax({
				type: "POST",
				url: $("#Form").attr("action"),
		    	data: $("#Form").serialize(),
				dataType:'json',
				cache: false,
				success: function(data){
					if(data.msg == "success"){
						alert("审批成功!");
						location.href = "<%=basePath%>acttask/todo.do";
					}
				}
			});
		}
		
		function noagree(){
			$('#flag').val('no');
			$.ajax({
				type: "POST",
				url: $("#Form").attr("action"),
		    	data: $("#Form").serialize(),
				dataType:'json',
				cache: false,
				success: function(data){
					if(data.msg == "success"){
						alert("驳回成功!");
						location.href = "<%=basePath%>acttask/todo.do";
					}
				}
			});
		}
		
		$(top.hangge());
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.date-picker').datepicker();
		});
		
		</script>
</body>
</html>